package com.hao.proxy;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

public class GreetingThrowAdvice implements ThrowsAdvice {
    public void afterThrowing(Method method, Object[] objects, Object target, Exception e) {
        System.out.println("----------- Throw Exception -----------");
        System.out.println("Target Class: " + target.getClass().getName());
        System.out.println("Method Name: " + method.getName());
        System.out.println("Exception Message: " + e.getMessage());
        System.out.println("---------------------------------------");
    }
}
